#ifndef __ATLAS_CONTENT_DB_API__
#define __ATLAS_CONTENT_DB_API__

#pragma pack(push)
#pragma pack(4)

struct A_CONTENT_OBJECT;

namespace Atlas
{
	namespace ContentObject
	{

		bool Register(const DDLReflect::STRUCT_INFO* info);
		void GetTypeList(std::vector<const DDLReflect::STRUCT_INFO*>& list);
		_U16 GetTypeId(const char* name);
		const DDLReflect::STRUCT_INFO* GetType(const char* name);
		const DDLReflect::STRUCT_INFO* GetType(int id);

		A_CONTENT_OBJECT* Create(const DDLReflect::STRUCT_INFO* info, A_UUID& uuid);
		A_CONTENT_OBJECT* Alloc(const DDLReflect::STRUCT_INFO* info, const A_UUID& uuid);
		void Delete(const A_UUID& uuid);
		const DDLReflect::STRUCT_INFO* GetType(const A_UUID& uuid);
		const A_CONTENT_OBJECT* Query(const A_UUID& uuid, const DDLReflect::STRUCT_INFO* info=NULL);
		A_CONTENT_OBJECT* Modify(const A_UUID& uuid, const DDLReflect::STRUCT_INFO* info=NULL);
		bool GetList(const DDLReflect::STRUCT_INFO* info, std::vector<A_UUID>& list);

		void CreateContentGroup(const DDLReflect::STRUCT_INFO* info, const char* name, const char* file);
		const char* QueryContentGroupName(const DDLReflect::STRUCT_INFO* info);
		const char* QueryContentGroupFile(const DDLReflect::STRUCT_INFO* info);

		void GetContentFileList(std::map<std::string, bool>& list);

		bool LoadContent();
		bool SaveContent(const char* file=NULL, bool force=false);

	}
}

#pragma pack(pop)

#endif
